Skip to content

fix(fleet-config): validate [[proxy.services]] rows at load (#6397) - #8405

Merged
dezren39 merged 2 commits into
mainfrom
queue/10815-6397-services-validation
Nov 11, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/10815-6397-services-validation

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Closes #6397.

Problem

fleet-config loaded [[proxy.services]] rows with no value validation: duplicate ports silently collapsed last-wins when fleet-proxy collected the rows into its port-keyed routing map, duplicate names made the advertised hello map ambiguous, and port 0 / empty-name rows loaded verbatim (verified by the triage probe in task 10813: dup-port load_ok rows=2 map_len=1).

Change

Config::validate in pkgs/fleet/crates/fleet-config/src/lib.rs now checks every declared row, in the crate's loud-at-load idiom, and rejects with a ConfigError::Parse naming the offending row:

  • port 0,
  • empty (or whitespace-only) name,
  • a port already used by an earlier row,
  • a name already used by an earlier row.

The built-in default services table is not validated (per the packet scope) and services() behaviour for valid tables is unchanged — a valid multi-row table loads verbatim.

Tests

cargo test -p fleet-config — 43 passed, 0 failed, including five new pinning tests beside services_come_from_config_when_declared: one per rejected shape (the duplicate-port test is the probe's impostor case) plus the valid-table control. rustfmt clean.

Queue task 10815 (repo-health-code-pilot), lane code-l.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Duplicate ports silently collapsed last-wins in fleet-proxy port-keyed routing map, duplicate names made the hello map ambiguous, and port 0 / empty-name rows loaded verbatim (issue #6397). Config::validate now rejects all four shapes with a ConfigError::Parse naming the offending row, in the crate loud-at-load idiom; the built-in default table is untouched. Five pinning tests cover each rejected shape plus a valid multi-row table.
@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 01:48
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 47 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2a6d2f5b-78d5-471c-9397-a5a75ef0b5c4
Commits

Reviewing files that changed from the base of the PR and between f7b9a62 and f9a61fe.

Files ignored due to path filters: 1

  • pkgs/fleet/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 2

  • pkgs/fleet/crates/fleet-config/Cargo.toml
  • pkgs/fleet/crates/fleet-config/src/lib.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T01:58:55.456707Z f9a61fe Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5663c605e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Codex P1 on PR #8405 (testing doctrine): the four [[proxy.services]] invariants (nonzero ports, nonblank names, unique ports, unique names) now have generated coverage — 256 proptest cases draw tables from collision-heavy pools and check load acceptance against an independent predicate, including arbitrary row order and whitespace-only names; an empty table is the documented built-in fallback. proptest 1.12 dev-dependency, matching the sibling fleet crates.
@dezren39

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: f9a61fe53c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant